package com.zm.Study01_FileOutputStreamTest;

import java.io.FileOutputStream;
import java.io.IOException;

/**
 * 异常处理
 */
public class FileOutputStreamException {


    public static void main(String[] args) {
        FileOutputStream fos=null;
        try {
            fos=new FileOutputStream("D:\\project\\IDEAPROJECT\\JavaIO\\src\\main\\resources\\static\\FileOutputStreamTxt\\fos.txt");
            fos.write(97);
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            if (fos!=null){
                try {
                    fos.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }else
            {
                System.out.println("fos为null");
            }

        }
    }
}
